package saas.dev.webflux.webflux.generator;

import org.springframework.context.annotation.Configuration;
import reactor.core.publisher.Flux;
import saas.dev.webflux.webflux.domain.Good;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName : GoodGenerator
 * @Author : y1
 * @Date: 2022/3/25 14:07
 * @Description :
 */
@Configuration
public class GoodGenerator {
    public Flux<Good> findGoods() {
        List<Good> goods = new ArrayList<>();
        goods.add(new Good(1, "小米", "2000"));
        goods.add(new Good(2, "华为", "4000"));
        goods.add(new Good(3, "苹果", "8000"));
        return Flux.fromIterable(goods);
    }
}
